import { createRouter, createWebHistory } from "vue-router"
import pinia from '../store'
import { useRouterStore, useIndexStore } from "../store/path"
const routerStore = useRouterStore(pinia)
const indexStore = useIndexStore(pinia)

const routes = [
    {
        path: "/",
        redirect: 'home',
        component: () => import("@/views/index.vue"),
        children: [{
            path: 'home',
            component: () => import("@/views/home/index.vue"),
            name: 'home'
        },
    ]
    },
]


const router = createRouter({
    history: createWebHistory(),
    linkActiveClass: 'active',
    routes: routes,
    scrollBehavior() {
        return { top: 0 }
    },
})
router.beforeEach((to, from, next) => {
    next()
})
export default router